//
//  NSBundle+SSAdd.m
//  VoiceAssistant
//
//  Created by G on 2020/2/19.
//  Copyright © 2020年 G. All rights reserved.
//

#import "NSBundle+SSAdd.h"

@implementation NSBundle (SSAdd)

+ (NSBundle *)chatBundle {
    NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"VoiceAssistant" ofType:@"bundle"];
    if (bundlePath == nil) {
        return [NSBundle mainBundle];
    }
    
    return [NSBundle bundleWithPath:bundlePath];
}

+ (NSString *)chatImageWithName:(NSString *)name {
    if ([[NSBundle chatBundle] isEqual:[NSBundle mainBundle]]) {
        return name;
    }
    return [[[NSBundle chatBundle].bundlePath lastPathComponent] stringByAppendingPathComponent:name];
}

@end
